n = int(input().split()[0])
X = input().split()
H = input().split()

def solve(x) :
	if(x < 60):
		return 0.0
	return 4 - 3 * (100-x) * (100-x) / 1600
ans = 0.0
SS = 0.0
for i in range(0, n):
	X[i] = int(X[i])
	H[i] = float(H[i])
#	print(solve(X[i]))
	ans = ans + solve(X[i]) * H[i]
	SS = SS + H[i]
ans = ans / SS
print("%.3lf"%ans)